package com.peace.hospital.feign.outpatientdepartment.controller;


import com.peace.hospital.entity.common.People;
import com.peace.hospital.feign.outpatientdepartment.service.OutpatientDepatmentService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 收费模块
 * </p>
 *
 * @author 谢晓峰
 * @since 2019-11-11
 */
@RestController
@RequestMapping("/particulars")
public class ParticularsController {
    @Autowired
    private OutpatientDepatmentService outpatientDepatmentService;
    /**
     * 通过病人姓名&身份证号查询消费信息计算总消费表
     */
    @RequestMapping(value = "/select", method = RequestMethod.GET)
    @RequiresRoles(value = {"root", "outpatentdepatment"}, logical = Logical.OR)
    public String findConsumptionDetailsByNameAndCard(People people) {
        return outpatientDepatmentService.findConsumptionDetailsByNameAndCard(people);
    }
    /**
     * 通过病人ID结算
     */
    @RequestMapping(value = "/settlement", method = RequestMethod.GET)
    @RequiresRoles(value = {"root", "outpatentdepatment"}, logical = Logical.OR)
    public String peopleSettlementById(People people) {
        return outpatientDepatmentService.peopleSettlementById(people);
    }
}
